package org.babelstudio.android.PDFImageReader;

import java.util.ArrayList;
import java.util.List;

import com.itextpdf.text.pdf.parser.ImageRenderInfo;
import com.itextpdf.text.pdf.parser.PdfImageObject;
import com.itextpdf.text.pdf.parser.RenderListener;
import com.itextpdf.text.pdf.parser.TextRenderInfo;

public class PDFRenderListener implements RenderListener {
	List contents = new ArrayList();
	
	public void clearContents() {
		contents.clear();
	}
	
	@Override
	public void beginTextBlock() {
		// TODO Auto-generated method stub

	}

	@Override
	public void endTextBlock() {
		// TODO Auto-generated method stub

	}

	@Override
	public void renderImage(ImageRenderInfo renderInfo) {
		// TODO Auto-generated method stub
		contents.add(renderInfo.getImage());
	}

	public List getContents() {
		return contents;
	}

	@Override
	public void renderText(TextRenderInfo renderInfo) {
		// TODO Auto-generated method stub
		contents.add(renderInfo.getText());
	}

}
